import React from 'react';
import { useNavigate } from 'react-router-dom';
import './PageCommon.css';

function ProfileManagement() {
  const navigate = useNavigate();

  const handleLogout = () => {
    // 清除登录信息
    localStorage.removeItem('user_info');
    localStorage.removeItem('token');
    localStorage.removeItem('isLoggedIn');
    
    console.log('用户已退出登录');
    
    // 跳转到登录页
    navigate('/login');
  };

  return (
    <div className="page-container">
      <div className="page-header">
        <h2>个人管理</h2>
      </div>
      <div className="page-content">
        <div className="profile-section">
          <button className="logout-btn" onClick={handleLogout}>
            退出登录
          </button>
        </div>
      </div>
    </div>
  );
}

export default ProfileManagement;

